UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XLXOzgPA4ZnSSSsSeIe6CydEgWyskthYeZQ6tDjKt/U='
WHERE
key_id = 'cc7b70953aa676d5dffd326461a25f2950a7f357ebf2ba65bd62e2757fc3f4f4'
AND (
token = 'XLXOzgPA4ZnSSSsSeIe6CydEgWyskthYeZQ6tDjKt/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)