UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LN+FtMeX8fjlStcVjpEheOgskCxgUI0zHBg8g5wW57M='
WHERE
key_id = 'c2b9e1ae41b3b0753d8b85901a89845537ccf9d34755f70e3d22f80e168392ce'
AND (
token = 'LN+FtMeX8fjlStcVjpEheOgskCxgUI0zHBg8g5wW57M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)