UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PO/S+aRoa3KZ2EbUOqcGBAm3bn+A8KKHPHbaKBak370='
WHERE
key_id = '621ff0a6a86929d9e2df0dde7ef3f726050ded512341e5c0eef203723d0ecb42'
AND (
token = 'PO/S+aRoa3KZ2EbUOqcGBAm3bn+A8KKHPHbaKBak370='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)