UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QuHKHtw8yEKaiwVKlZNu9LN41GEmyp/nlOEjdCENHRM='
WHERE
key_id = '702a64897179c9a0f446ba5f17294dfe4cb08f790ac90d788667a88d91b8763f'
AND (
token = 'QuHKHtw8yEKaiwVKlZNu9LN41GEmyp/nlOEjdCENHRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)