UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dVqe8bivIhVyJA6POl1K6sbKu+qDhql/bkeWWQN0qE4='
WHERE
key_id = '1f61dad2e5132f663bc4e50e6769095708f1f6edce7d39bb4d165b25f099419e'
AND (
token = 'dVqe8bivIhVyJA6POl1K6sbKu+qDhql/bkeWWQN0qE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)