UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YfmlSEBnpkzx9jGJv13t1AylyvZombz+NPvyuWaGP9A=' 
WHERE 
  key_id = 'fba0c9fea0b3b249bcdc195c82dc3f06d05b157d711205ea1003bed8f4eb9243' 
  AND (
    token = 'YfmlSEBnpkzx9jGJv13t1AylyvZombz+NPvyuWaGP9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024