UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FYt2OhqcoLJbwCJNB+qUXvw1GLJMwo53ko2kotJX6pI='
WHERE
key_id = 'bf83f70f3d9de6ffd34846ea8f9a097e72e4bf0e41eadc6c4bc95e7e1b95f21d'
AND (
token = 'FYt2OhqcoLJbwCJNB+qUXvw1GLJMwo53ko2kotJX6pI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)