UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KTj7d/jyKYO/rhWXQnOadBMCEyzzmPi0EvLCyXqFQ3M='
WHERE
key_id = '1dc9ab864a9dd3265d63feb31c10a7c37259998b218339a0bb40826fc16feab7'
AND (
token = 'KTj7d/jyKYO/rhWXQnOadBMCEyzzmPi0EvLCyXqFQ3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)