UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x4ekS7XFEJ1u1nkvV7X5iFG4xYk/8I9Vxt1eCAs1wPQ=' 
WHERE 
  key_id = 'f458f1ea943afe536882ff0c1b151270874d5baa2fbbff32057afc127ab4bbbd' 
  AND (
    token = 'x4ekS7XFEJ1u1nkvV7X5iFG4xYk/8I9Vxt1eCAs1wPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035