UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'glztSPcDueEnWAjPPZRr5se+ptzpqWgemaZVM9jlM2Y=' 
WHERE 
  key_id = 'dfed03bff6c6136fca6efc902c9a0ec93d13379a0bbcea379d07a87036a1b278' 
  AND (
    token = 'glztSPcDueEnWAjPPZRr5se+ptzpqWgemaZVM9jlM2Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023