UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IxjVHNsuRTs0iZbWQbPEGWVdQHsEr/hq7n/N/Dt5jH4='
WHERE
key_id = '9efa762bb59768057a9a4afabb0d0566df940e98402aadcba9ccef649ddb34f6'
AND (
token = 'IxjVHNsuRTs0iZbWQbPEGWVdQHsEr/hq7n/N/Dt5jH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)