UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h66+AKbCzTVq00I/a6V24OpMjTGJZJ3pu2zAUUJ5B4s=' 
WHERE 
  key_id = 'c88fd05992033e79c87b1e653c1ad2a1a4c45cdb40fb9d9138314ffb1ba50cfb' 
  AND (
    token = 'h66+AKbCzTVq00I/a6V24OpMjTGJZJ3pu2zAUUJ5B4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038