UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aNfSu0K0uWoWnohXfzSMfW5y3bMx8p+KWvzo6spm7+c=' 
WHERE 
  key_id = 'f3d6becf92d9d7f010157f06c6d3fb4809c904813dc78a6e6c9ad0ea4d982382' 
  AND (
    token = 'aNfSu0K0uWoWnohXfzSMfW5y3bMx8p+KWvzo6spm7+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030