UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Beu1xaGuxGldl2CPxLChrB/r5l7GHr7xA1guKWw5tc=' 
WHERE 
  key_id = '7cc2e7658b2b8e775f8ac85b52ef5df36064bb52bea7d666437d0c281e9b903b' 
  AND (
    token = '/Beu1xaGuxGldl2CPxLChrB/r5l7GHr7xA1guKWw5tc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025