UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UVr3J1zpuSV6vW4ZdDaR6PEX9GGoPsxQkbnufyk25E0=' 
WHERE 
  key_id = '5d76082bb5cf2e665b46cbcea4a063a55dfdc2e01217931a3165332ba4c07f44' 
  AND (
    token = 'UVr3J1zpuSV6vW4ZdDaR6PEX9GGoPsxQkbnufyk25E0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033