UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4pXR8guGoCqH52b06KW2UPcNh7pGKlp1i7C2+2HpQtM=' 
WHERE 
  key_id = 'becc4e13ae5e9fd5b93c90031ba60564f3cd527509b109eeea1bf2ce253af15d' 
  AND (
    token = '4pXR8guGoCqH52b06KW2UPcNh7pGKlp1i7C2+2HpQtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026