UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UZzpU2p6ZRNucNP+8UILLRbBI97a/nwVzrDlXDR26K0=' 
WHERE 
  key_id = 'b18e8b679c86b5ead457716c9b32dce6eb0c3c75d807eaa37d195620e9317224' 
  AND (
    token = 'UZzpU2p6ZRNucNP+8UILLRbBI97a/nwVzrDlXDR26K0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041