UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h2vcMdk4HBmn+a1Kuh3rO/hJX2E5xpgld6fN+aXp8ug='
WHERE
key_id = 'dd12da426bd154a07a6d38a0167bc4cfaa9b0dce06fb9e12dc99283206c860d4'
AND (
token = 'h2vcMdk4HBmn+a1Kuh3rO/hJX2E5xpgld6fN+aXp8ug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)