UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0vF6w3khdH7EaC18FugvzBjSjfpPiBhm4UB3xFiowG4=' 
WHERE 
  key_id = 'a72a1999cdbe1e4e51eb2e9c677851c9a62922c78cd8178dd53ebeb8789f4ed0' 
  AND (
    token = '0vF6w3khdH7EaC18FugvzBjSjfpPiBhm4UB3xFiowG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023