UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jYKO7gOzYVIJUqVBDaG8WtrkxvEb2X8HTCf5vyK3A2o=' 
WHERE 
  key_id = '64325aac8184eeeff81cd60ec4f54b4fe63fe8a08c8183d9e2db231c1028dd3b' 
  AND (
    token = 'jYKO7gOzYVIJUqVBDaG8WtrkxvEb2X8HTCf5vyK3A2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020