UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xs9zO6X1lGPmCItIeaykJRsZW4J5pfvsqxYIg/I4j0M='
WHERE
key_id = 'a83f92c85ed96b10c7b9fdfbd99d0fb3c7516ea968382a8b236dbae6f7278ca2'
AND (
token = 'xs9zO6X1lGPmCItIeaykJRsZW4J5pfvsqxYIg/I4j0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)