UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '46C7ruk2QUdtJzztaMC5ty/KP8TcaxLy9xRXxxVmSY4=' 
WHERE 
  key_id = '532398f586d0a663963e41b07f9794d8aef25ed2473e70526bad8ee6ca17c4c0' 
  AND (
    token = '46C7ruk2QUdtJzztaMC5ty/KP8TcaxLy9xRXxxVmSY4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027