UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ol4UFLR8Yp4NjIeo/+cupVHhSLbJUs46xaPsFqUeqbQ=' 
WHERE 
  key_id = '01fcaa5a5a4bcbac6c2a8cbf449b7e39bd921f77af34734cc23f0762034b5f77' 
  AND (
    token = 'Ol4UFLR8Yp4NjIeo/+cupVHhSLbJUs46xaPsFqUeqbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017