UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tW4T48kHjER0G5YFEh1bSylqMO+AK+l0QzCvk3HesSw=' 
WHERE 
  key_id = 'ced7cfe7129737fb4ccb9c5c8047a6f883b385627065aa2ef3b60a6f0edcf0a6' 
  AND (
    token = 'tW4T48kHjER0G5YFEh1bSylqMO+AK+l0QzCvk3HesSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033