UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vZpBjPr3odRvoVOUeX8kzwISU/aBLVYemOqyE8eABgA='
WHERE
key_id = '0db5a04998add26f41c1e445b4e224429db9d133d61b89b11c020c7bc0965e0d'
AND (
token = 'vZpBjPr3odRvoVOUeX8kzwISU/aBLVYemOqyE8eABgA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)