UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GskOUfR2DsUMK5JKnOY3PvAyIWVZY6KcE1ca5ZjBuPA=' 
WHERE 
  key_id = 'd37620c9ec9d6059f44137465d15dc9671dbec80895aec9690687831030de4e5' 
  AND (
    token = 'GskOUfR2DsUMK5JKnOY3PvAyIWVZY6KcE1ca5ZjBuPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038