UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4G1UZ0VUnqtFiE69IQ9WOiXnzbMyK6JpCRdezLZ7Wto=' 
WHERE 
  key_id = 'eb43d4d33b8054df0379c26c833645d115f1100933f081278f5d67904a00c138' 
  AND (
    token = '4G1UZ0VUnqtFiE69IQ9WOiXnzbMyK6JpCRdezLZ7Wto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035