UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jT8j/HuGvfoQeo4uLnaYGoppnC2yenBmGfmWQ8CFZSI='
WHERE
key_id = 'd8c7161c9b748a8ff47f564ce19e68e9eb69dc291026c9b8a7438f20d5f597c2'
AND (
token = 'jT8j/HuGvfoQeo4uLnaYGoppnC2yenBmGfmWQ8CFZSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)