UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Cr2oe0O6necDI3876ySnQ9HSVMI27YMMWVVbJzLjiE=' 
WHERE 
  key_id = '4102eb5c7299d5538ee9b98809b69264c731b988638d376b872696892adcdba7' 
  AND (
    token = '/Cr2oe0O6necDI3876ySnQ9HSVMI27YMMWVVbJzLjiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034