UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6IzmaRZkODkTr+/7E4iTszV0HdFw/+ogwcZK4ykP4eE='
WHERE
key_id = '41bb7cbfce1e9c98ad9961c823981f0ac1ea8208c08f1dc2fa3c0a08a32dd1ac'
AND (
token = '6IzmaRZkODkTr+/7E4iTszV0HdFw/+ogwcZK4ykP4eE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)