UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sGDCskWXr8llIqMcE2JkSA0rouCey5UzTyKTsGH/Xf8='
WHERE
key_id = '836b4468d56f235b75834b17459f1cd247eea314a60f791453fcce58535d8bdc'
AND (
token = 'sGDCskWXr8llIqMcE2JkSA0rouCey5UzTyKTsGH/Xf8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)