UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ECxuM3d4ZtNybxEDGwlOhAJ7CDzreLLpnOkQzB3dboo=' 
WHERE 
  key_id = '0be4cc38e158748f9a41b5945b81dfbc28eec807eca43f77827087c5bd83f65d' 
  AND (
    token = 'ECxuM3d4ZtNybxEDGwlOhAJ7CDzreLLpnOkQzB3dboo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027