UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bu6RkX840Fjpzljm+R4jMi09NVA3VLA6PrXGNGHy288=' 
WHERE 
  key_id = 'f9e9f1b7ce660f89eddb0aeebaf9565e99b5ad574d4e8e39ec0ff6fddb5a53e9' 
  AND (
    token = 'Bu6RkX840Fjpzljm+R4jMi09NVA3VLA6PrXGNGHy288=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026