UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DJtVmVxechINrzNgluL2LC+7OyWVLHwJUDjIIc8c/+c='
WHERE
key_id = '7772529687ba634a923becfe8184ddace5227a91888a5c384d4a4c2e3bd24385'
AND (
token = 'DJtVmVxechINrzNgluL2LC+7OyWVLHwJUDjIIc8c/+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)