UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yqbc6Kdpx7l91Yo4axKIcjXFocVVWs0lzIgFsQjnYUo='
WHERE
key_id = '9f8eb88318a91bc4fdf1992aa8b0c76c0d9be3b7b20a1392e4fa7208a0979f26'
AND (
token = 'Yqbc6Kdpx7l91Yo4axKIcjXFocVVWs0lzIgFsQjnYUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)