UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Tuk20bhlvAEpcPWEtShNbWY8/SV9+GEJ6SnHTXjBPI=' 
WHERE 
  key_id = '5715901a2f1eacb0673faacf83d555cd62c8f39cbdf73302bd58f2a7aa465be2' 
  AND (
    token = '+Tuk20bhlvAEpcPWEtShNbWY8/SV9+GEJ6SnHTXjBPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037