UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pEz+8uoqRR9jQh5mOZ/u6E963SkDNOauEkuPO+LIiXg='
WHERE
key_id = '43f1f722c1c8adff273390c323deb0a48da82c2efbdd1e73abc1f76e870bf428'
AND (
token = 'pEz+8uoqRR9jQh5mOZ/u6E963SkDNOauEkuPO+LIiXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)