UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1tkVsrVRPZvI3ztlc30q2nycPoErh50oJjF5144+1EY=' 
WHERE 
  key_id = '8fc26f038cfcdfe2773732e84f0242903375c44bfcc37d8ea4d92a818fd7c5ba' 
  AND (
    token = '1tkVsrVRPZvI3ztlc30q2nycPoErh50oJjF5144+1EY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032