UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zUdbpluodKwDKNrZ4IaTh6gV8rdAuZpZNaat1geq/vc=' 
WHERE 
  key_id = '82dbdc024bacbe02cd2237b8a0f0b131b7dfdc57da7c8c8c8f1fefb3be790f1e' 
  AND (
    token = 'zUdbpluodKwDKNrZ4IaTh6gV8rdAuZpZNaat1geq/vc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036