UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/RA8kTRyU8DeMVyGvXZH8/mJsjt77AxnlR5ATSXsNhA='
WHERE
key_id = 'bb4a523e649cda18a025e8ef20e1c1ff2e5bdb09b9c9d5dfb2204a2eaeb3db2b'
AND (
token = '/RA8kTRyU8DeMVyGvXZH8/mJsjt77AxnlR5ATSXsNhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)