UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qUMfsU+3GNO4pASaprmYEmYkqhb0pQnvbG9C/7N6cRI='
WHERE
key_id = '0114687addfcb1342f1a39f023388844632e71b4f35fa63b7f7b6bc89ddcb468'
AND (
token = 'qUMfsU+3GNO4pASaprmYEmYkqhb0pQnvbG9C/7N6cRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)