UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'breN9j3uQ2bMcv0RsnbI8Pkk+HzGwfbBTz/qjvU1xDE='
WHERE
key_id = 'f30be84bc210ab8de8b29234b1f7a8c38de3718bee9bfbef636cba37589676c9'
AND (
token = 'breN9j3uQ2bMcv0RsnbI8Pkk+HzGwfbBTz/qjvU1xDE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)