UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jnPuf4N7Pwd4zHe8AmeZ0wYVd+wGj3fHHvrhQa0hJ4c='
WHERE
key_id = '93773d9704247334f09a29a379ac285379d01336733020262a2d4fa9720e31e7'
AND (
token = 'jnPuf4N7Pwd4zHe8AmeZ0wYVd+wGj3fHHvrhQa0hJ4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)