UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pQ0mcubsDsuPtVRM5kih9VeI9g+0mETIxq/sad0uJwk='
WHERE
key_id = 'b796298dee19c9382ef70dfdc3c1498198146a34d9ad5e3abb87f537e2747264'
AND (
token = 'pQ0mcubsDsuPtVRM5kih9VeI9g+0mETIxq/sad0uJwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)