UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fk9FbeTdqY7KuNATzHNCZTm+iEXDF6xjVCeq284F4Yc='
WHERE
key_id = '9dfa99aea3ae35e0c21d51f6885548b0aa65b1290ebe2eec2d8f29a1c273cf11'
AND (
token = 'fk9FbeTdqY7KuNATzHNCZTm+iEXDF6xjVCeq284F4Yc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)