UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V6N1dpUG2No5EY2SpvkjjDBTJuNFfun8L3qp//HLOX8='
WHERE
key_id = '40234b66957b3b3788190426d6351bc6b2cea211327d300467fecc4ca0b6c0c3'
AND (
token = 'V6N1dpUG2No5EY2SpvkjjDBTJuNFfun8L3qp//HLOX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)