UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V2WBViuwLp/MrCEHMkpm+RHhc1JXa9o6o5rgzWpiWF0=' 
WHERE 
  key_id = '02bc6cbab5b62a6143894a600e2abfed8872cd2d7743d2cdf9029953e7ac37dc' 
  AND (
    token = 'V2WBViuwLp/MrCEHMkpm+RHhc1JXa9o6o5rgzWpiWF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024