UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlUUZzJuD5rY3Nk/7i++rLEs8Mc93TifwJeE5feY728=' 
WHERE 
  key_id = 'adfc2ac0a2e8e8a5ef5e1b8584f3d93fdd6548b0cfe878f0dbb359928a65c398' 
  AND (
    token = 'rlUUZzJuD5rY3Nk/7i++rLEs8Mc93TifwJeE5feY728=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035