UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y6fr9NuR9/HhmMGW8eCoxnKbf6WqU6s0XLusImu+qeA=' 
WHERE 
  key_id = '75cea099c37c21f7d7532452ed8b27da980ba2af9ed0a44124f617d56b48c46d' 
  AND (
    token = 'y6fr9NuR9/HhmMGW8eCoxnKbf6WqU6s0XLusImu+qeA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019