UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zZdqV40f3/GiwAY5FdN7KiusioPj8Bcmq4qrawbnLRQ=' 
WHERE 
  key_id = '31e2660577186673d912b6210d881a6ee07f0300280974b839fa7f5c502b9c05' 
  AND (
    token = 'zZdqV40f3/GiwAY5FdN7KiusioPj8Bcmq4qrawbnLRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051