UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P0Lbvtq/vRlJHIQcYFraBOnq+IMtrQPqVPGod7zqNws='
WHERE
key_id = '015cafef117e7deecc4c00006308707618fb39fd1be53d8e8790d3b116567342'
AND (
token = 'P0Lbvtq/vRlJHIQcYFraBOnq+IMtrQPqVPGod7zqNws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)