UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pP5+aBIQM9Z/iknI8G27nFRvw8tIe2Lg6DjUaIlEv6w='
WHERE
key_id = '0e57989954f22b5f926096e41834e6a0cfd731d12c5d31f903b635fc70ab1acf'
AND (
token = 'pP5+aBIQM9Z/iknI8G27nFRvw8tIe2Lg6DjUaIlEv6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)