UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Qk9YEkmQR/kh0VkT02u3FgBSGz1L+Br1FXOA+lRN4U=' 
WHERE 
  key_id = '9a99806c7c42e8b29ab8e8d13e57178460d33243c12088fb3864980c82ef5dc8' 
  AND (
    token = '3Qk9YEkmQR/kh0VkT02u3FgBSGz1L+Br1FXOA+lRN4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020