UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NTRpLjbztPUPF6mraT4g6vv6Gm/o+9b9yaH2IJXvdI4=' 
WHERE 
  key_id = 'ddae468d5d8af33516b0ccda5ed8dd0ffc0c42d6b03af4e2c7729d5be92229a6' 
  AND (
    token = 'NTRpLjbztPUPF6mraT4g6vv6Gm/o+9b9yaH2IJXvdI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046