UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3+1ti62sDbSb0+diavGMxV/6doiUe81/bR+7EJ7h24U='
WHERE
key_id = '033eaf8ea3e33d536481137d4fea4a774b9d4b44b29ba6dfafc0225acc51a196'
AND (
token = '3+1ti62sDbSb0+diavGMxV/6doiUe81/bR+7EJ7h24U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)